package com.bqy.locationfactory.Gaode;

import android.content.Context;
import android.os.Bundle;
import android.view.View;

import com.amap.api.maps2d.MapView;
import com.bqy.locationfactory.base.AbsMapView;

/**
 * Created by lenovo on 2018/1/7.
 */

public class GaodeMapView extends AbsMapView {

    private MapView mapView;

    public GaodeMapView(Context context) {
        super(context);
    }

    private MapView getMapView() {
        if (mapView == null) {
            mapView = new MapView(getContext());
        }
        return mapView;
    }

    @Override
    public MapView getView() {
        return getMapView();
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getMapView().onCreate(savedInstanceState);
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        getMapView().onSaveInstanceState(outState);
    }

    @Override
    public void onResume() {
        getMapView().onResume();
    }

    @Override
    public void onPause() {
        getMapView().onPause();
    }

    @Override
    public void onDestroy() {
        getMapView().onDestroy();
    }
}
